<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function ask(ques, yes, no) {
        if (confirm(ques)) {
          yes();
        } else {
          no();
        }
      }
      ask(
        "hello ?",
        () => console.log("hello cb"),
        () => console.log("hi cb")
      );

      // const f1 = () => console.log("hello cb");
      // const f2 = () => console.log("hi cb");
      // ask("hello ?", f1, f2);
    </script>
  </body>
</html>
